<?php
namespace App\Http\ViewComposers;

use Illuminate\Contracts\View\View;
use App\Repositories\BLL\MenuBLL;

class MenuComposer
{
    protected $menuBLL;

    public function __construct(MenuBLL $menuBLL)
    {
        $this->menuBLL = $menuBLL;
    }

    /**
     * 绑定数据到视图.
     *
     * @param View $view
     * @return void
     */
    public function compose(View $view)
    {
        $view->with('sideBarMenus', $this->menuBLL->getMenuList());
    }
}